#pragma once

#include "CoreMinimal.h"
#include "Components/BoxComponent.h"
#include "GameFramework/Actor.h"
#include "JumpProp.generated.h"

UCLASS()
class AJumpProp : public AActor
{
	GENERATED_BODY()

public:
	AJumpProp();

	virtual void BeginPlay() override;

	virtual void Tick(float DeltaTime) override;

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "通用设置", DisplayName = "启用跳跃")
	bool bEnableJump = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "通用设置", DisplayName = "跳跃力度")
	float JumpZ = 1000;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "通用组件", DisplayName = "跳台范围")
	TObjectPtr<UBoxComponent> BoxComponent;

	UFUNCTION()
	void OnOverlapBegin(
		UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
		UPrimitiveComponent* OtherComp, int32 OtherBodyIndex,
		bool bFromSweep, const FHitResult& SweepResult
	);
};
